<? $base_url = base_url(); ?>
<table class="pagetable" cellspacing="1" cellpadding="2">
	<thead>
		<th width="2em">Id</th>
		<th width="80px"></th>
		<th>Nombre</th>
		<th width="30%">Usuario</th>
		<th width="10%" colspan="2">Denuncias</th>
		<th width="30px">Status</th>
	</thead>
	<tbody>
		<?
		foreach ($channels as $ix => $channel) {
			echo ($ix % 2) == 0 ? "<tr class=row1>":"<tr class=row2>";
		?>
			<td>
				<? echo $channel->suite_id; ?>
			</td>
			<td>
				<img  height="60" width="80" src="<?= $channel->thumb == NULL ? ($base_url."images/goalbit.jpg"):("data:image/png;base64,".$channel->thumb) ?>" alt="Logo del canal">
			</td>
			<td>
				<? echo $channel->name; ?>
			</td>
			<td><? echo $channel->user_name; ?></td>
			<td align="right"><? echo $channel->cant_denuncias; ?></td>
			<td align="center">
				<?
				if($channel->cant_denuncias > 0){
					echo "<img src='".$base_url."images/eye.png' title='Ver Denuncias' width='16px' height='16px' class='icon_tool' onclick='init_denuncias(".$channel->suite_id.");'>";
				} ?>
			</td>
			<td align="center">
				<?
					echo $channel->active==1 ?
						"<img src='".$base_url."images/tick.gif' title='Desactivar' width='16px' height='16px' class='icon_tool' onclick='changeStatusChannel(0,".$channel->suite_id.");'>"
						:
						"<img src='".$base_url."images/delete.gif' title='Activar' width='16px' height='16px' class='icon_tool' onclick='changeStatusChannel(1,".$channel->suite_id.");'>";
					?>
			</td>
		<?
			echo "</tr>";
		}
		?>
	</tbody>
	<tfoot>
		<tr>
			<td colspan="5" style="padding-top: 5px;">
				<div class="pager_busq">
					<?
					if ($page > 1) {
						echo "<img src='$base_url/images/pager/prev.png' title='Anterior' onclick='prevPageCanales();'>";
					}

					echo " <span id='desc_pages'> $page de $pages </span>";

					if ($page < $pages) {
						echo "<img src='$base_url/images/pager/next.png' title='Anterior' onclick='nextPageCanales();'>";
					}
					?>
				</div>
			</td>
		</tr>
	</tfoot>
</table>
